/* 全局和基本布局 */
html, body {
    height: 100%;
    margin: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f5f7fa;
    overflow: hidden; /* 防止出现滚动条 */
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 顶部导航栏 */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e6e6e6;
    flex-shrink: 0;
}

.header-left .logo {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.header-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.search-bar {
    display: flex;
    width: 50%;
    max-width: 400px;
}

.header-right .layui-nav {
    background: none;
}

.header-right .layui-nav .layui-nav-item a {
    color: #333;
}

/* 主体区域 */
.main-container {
    display: flex;
    flex-grow: 1;
    height: calc(100% - 60px);
    background-color: #fff;
}

/* 第一栏: 账户和文件夹 */
.column-one {
    flex: 2;
    border-right: 1px solid #e6e6e6;
    background-color: #f5f7fa; /* 调整背景色 */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.column-one-header {
    padding: 10px;
    border-bottom: 1px solid #e6e6e6;
}

.header-buttons-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-buttons-spacer {
    flex-grow: 1;
}

#add-account-btn,
#compose-email-btn,
#toggle-folders-btn {
    flex-shrink: 0;
}

.column-one-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

.column-one-footer {
    padding: 15px;
    border-top: 1px solid #e6e6e6;
}

.column-one .layui-collapse {
    border: none;
    margin-bottom: 15px;
}

.column-one .layui-colla-item {
    border: 1px solid #e6e6e6;
    border-radius: 4px;
}

.column-one .layui-colla-title {
    background-color: #fff;
    font-size: 14px;
}

.column-one .layui-colla-content {
    padding: 10px;
    border-top: 1px solid #e6e6e6;
}

.column-one .layui-nav-tree {
    width: 100%;
    background: none;
}

.column-one .layui-nav-tree .layui-nav-item a,
.column-one .layui-nav-tree .layui-nav-child dd a {
    color: #333 !important;
}

/* 账户列表项 */
.account-list-item {
    margin-bottom: 5px;
}

.account-item-main {
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.account-list-item:hover:not(:has(.folder-item-container:hover)) > .account-item-main {
    background-color: rgba(193, 197, 201, 0.5);
}

.account-list-item.selected > .account-item-main {
    background-color: rgba(193, 197, 201, 0.8);
}

.toggle-icon-wrapper, .drag-handle-wrapper, .settings-icon-wrapper {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    color: #333; /* 设置图标颜色为深灰色 */
    transition: all 0.3s ease;
}
.toggle-icon-wrapper:hover, .drag-handle-wrapper:hover, .settings-icon-wrapper:hover {
    background-color: #dcdfe4;
}

/* 拖拽手柄特殊样式 */
.drag-handle-wrapper {
    margin-left: auto; /* 将拖拽手柄推到右侧 */
    margin-right: 4px; /* 与设置按钮保持一定间距 */
    cursor: grab; /* 拖拽光标 */
}

.drag-handle-wrapper:active {
    cursor: grabbing; /* 拖拽中的光标 */
}

.drag-handle-wrapper:hover {
    color: #1E9FFF; /* 悬浮时变为蓝色 */
}

/* 拖拽时的视觉反馈 */
.account-list-item.sortable-chosen .drag-handle-wrapper {
    color: #1E9FFF;
}

.account-list-item.sortable-ghost {
    opacity: 0.4;
}

.account-info-wrapper {
    flex-grow: 1;
    padding: 0 8px;
    overflow: hidden;
    color: #333 !important;
    /* 重置 a 标签默认样式 */
    text-decoration: none;
}

.account-display {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.account-name, .account-email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-name {
    font-size: 14px;
}
.account-email {
    font-size: 11px;
    color: #777;
}

.account-folder-dl {
    margin-top: 5px;
    margin-bottom: 5px;
    display: none; /* 默认折叠 */
}
.account-list-item.expanded > .account-folder-dl {
    display: block; /* 展开时显示 */
}
.account-folder-dl dd a {
    padding: 6px;
    border-radius: 4px;
    display: block;
}

.folder-item-container {
    display: flex;
    align-items: center;
    padding: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.folder-item-container:hover {
    background-color: rgba(193, 197, 201, 0.5);
}

.folder-item.selected > .folder-item-container {
    background-color: rgba(193, 197, 201, 0.8);
}

.folder-column {
    display: flex;
    align-items: center;
}

.folder-toggle {
    width: 24px;
    height: 38px;
    justify-content: center;
}

.folder-toggle .folder-toggle-icon {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 38px;
    text-align: center;
    font-size: 12px !important;
}

.folder-icon {
    width: 24px;
    justify-content: center;
    font-size: 16px;
    color: #555;
    margin-right: 2px;
}

.folder-link {
    flex-grow: 1;
    color: #333;
    text-decoration: none;
    padding: 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-actions {
    justify-content: center;
    margin: 0 5px;
}

/* 在触摸屏设备上始终显示 */
body.touch-device .folder-actions {
    opacity: 1;
}

/* 文件夹操作按钮默认在PC端隐藏 */
.folder-actions {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* PC端悬浮或选中时显示 */
body:not(.touch-device) .folder-item-container:hover .folder-actions,
body:not(.touch-device) .folder-item.selected .folder-actions {
    opacity: 1;
}

.folder-item-container .layui-icon {
    padding: 0 3px;
}

.add-subfolder-icon {
    font-size: 14px;
    color: #888;
}
.add-subfolder-icon:hover {
    color: #333;
}

/* 第二栏: 邮件列表 */
.column-two {
    flex: 3;
    border-right: 1px solid #e6e6e6;
    display: flex;
    flex-direction: column;
    min-width: 0; /* 防止 flex item 被内容撑开 */
    position: relative; /* 为折叠按钮提供定位上下文 */
    transition: flex 0.3s ease; /* 平滑过渡动画 */
}

.email-list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #e6e6e6;
    background-color: #f5f7fa;
    flex-shrink: 0;
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    font-size: 16px;
    color: #555;
}

.toolbar-btn:hover {
    color: #000;
}

#email-list-wrapper {
    overflow-y: auto;
    flex-grow: 1;
}

/* 第三栏: 邮件详情 */
.column-three {
    flex: 5;
    display: flex;
    flex-direction: column;
    min-width: 0; /* 防止flex子元素被内容撑开 */
}

/* 邮件列表为空时的占位符样式 */
.empty-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #999;
    font-size: 16px;
    text-align: center;
}

#email-list-wrapper.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 没有更多邮件提示样式 */
.no-more-emails-tip {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* 邮件列表项样式 */
.email-list {
    padding: 10px;
}

.email-item {
    position: relative;
    border-bottom: 1px solid #d3d3d3;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* 隐藏滑动内容 */
    background-color: #ffffff; /* 确保底层为白色，防止滑动时露出边框 */
    margin: 1px;
    /* 禁止长按选择文本（防止与长按菜单冲突） */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 禁止iOS长按弹出默认菜单 */
    -webkit-touch-callout: none;
}

.email-item-inner {
    position: relative; /* 为绝对定位的 actions 提供上下文 */
    z-index: 2; /* 中层：邮件内容 */
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 6px;
    background-color: #ffffff; /* 确保有背景色 */
    transition: all 0.2s;
    width: calc(100% + 2px); /* 增加宽度遮盖边框 */
    height: calc(100% + 2px); /* 增加高度遮盖边框 */
    min-height: 72px; /* 设置最小高度 */
    margin: -1px; /* 负边距补偿增加的宽高 */
    box-sizing: border-box;
}

.email-item.swiping .email-item-inner {
    transition: none; /* 滑动时禁用过渡动画 */
}

/* 下层：删除按钮 */
.delete-layer {
    position: absolute;
    top: 1px;
    left: 1px;
    bottom: 1px;
    right: 1px;
    border-radius: 6px;
    background: linear-gradient(to right, #ff9800, #ff5722);
    color: white;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* 靠右对齐 */
    font-size: 16px;
    font-weight: bold;
    z-index: 1;
    cursor: pointer;
    user-select: none;
}

.delete-layer .delete-content {
    margin-right: 30px; /* 内容距离右边缘30px，不靠边 */
    display: inline-flex;
    align-items: center;
}

.delete-layer i {
    margin-right: 8px; /* 图标在文字左侧 */
    font-size: 18px;
}

/* 上层：操作按钮 */
.email-item .email-item-actions {
    position: absolute;
    top: 8px; /* 与 .email-item-inner 的 padding-top 对齐 */
    right: 15px;
    display: none;
    gap: 5px;
    z-index: 3; /* 确保在最上层 */
}

.email-item .email-item-actions .layui-icon {
    font-size: 14px !important;
}

/* PC端悬浮显示按钮 */
.email-item:hover .email-item-actions {
    display: flex;
}

/* 触摸设备直接显示操作按钮（仅在非移动端） */
@media (min-width: 1001px) {
    .touch-device .email-item .email-item-actions {
        display: flex !important;
    }
}

/* 触摸设备直接显示文件夹操作按钮 */
body.touch-device .folder-actions {
    opacity: 1;
}

.email-checkbox-wrapper {
    margin-right: 15px;
    display: none; /* Initially hidden */
}

#email-list-container.multi-select-mode .email-checkbox-wrapper {
    display: block; /* Show in multi-select mode */
}

.email-content {
    position: relative; /* 设置为相对定位的容器 */
    padding-left: 15px; /* 恢复增加的前边距 */
    flex-grow: 1;
    cursor: pointer;
    overflow: hidden; /* Prevent content from expanding the container */
    white-space: nowrap;
}

.email-item:hover > .email-item-inner {
    background-color:rgb(255, 248, 236);
}

.email-item.selected > .email-item-inner {
    background-color:rgb(219, 219, 219);
}

.email-item.unread .email-sender,
.email-item.unread .email-subject {
    font-weight: bold; /* 只加粗发件人和主题 */
}

.email-item.unread .email-content::before {
    content: '';
    position: absolute;
    top: 5px; /* 向下一点 */
    left: 0; /* 向后一点 */
    width: 8px;
    height: 8px;
    background-color: #ff6b22; /* 橘红色 */
    border-radius: 50%;
}

.email-sender {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-sender-email {
    color: #888;
    font-size: 10px;
}

.email-subject {
    font-size: 13px;
    color: #555;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-preview {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 邮件文件夹标签样式 */
.email-folders-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 2px;
}

.email-folders-tags .folder-tag {
    display: inline-block;
    padding: 0px 2px;
    border: 1px solid #888;
    color:#888;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 新的邮件详情样式 */
.email-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.email-info-panel {
    padding: 20px;
    border-bottom: 1px solid #e6e6e6;
    background-color: #f9f9f9;
    flex-shrink: 0;
}

.email-info-panel .email-subject {
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    padding-right: 30px;
    /* 折叠状态：单行显示 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-info-panel.expanded .email-subject {
    /* 展开状态：显示全部内容，允许多行 */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    padding-right: 0;
}

.email-info-panel .email-subject::after {
    content: '\e61a'; /* layui-icon-down */
    font-family: 'layui-icon';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.3s;
}

.email-info-panel.expanded .email-subject::after {
    transform: translateY(-50%) rotate(180deg);
}

.info-content {
    display: none;
    margin-top: 15px;
}

.email-info-panel.expanded .info-content {
    display: block;
}

/* PC端默认展开邮件详情信息 */
@media (min-width: 1001px) {
    .email-info-panel .info-content {
        display: block;
    }
    .email-info-panel .email-subject::after {
        transform: translateY(-50%) rotate(180deg);
    }
    .email-info-panel.collapsed .info-content {
        display: none;
    }
    .email-info-panel.collapsed .email-subject::after {
        transform: translateY(-50%) rotate(0deg);
    }
}

.info-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.info-row .info-label {
    width: 70px;
    font-weight: bold;
    text-align: right;
    flex-shrink: 0;
    margin-right: 10px;
}

.info-row .info-value {
    flex-grow: 1;
}


.email-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 自定义翻译图标样式 */
.custom-icon-translate {
    display: inline-block;
    font-style: normal;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

/* 移动端邮件详情按钮只显示图标 */
@media (max-width: 1000px) {
   .email-actions .layui-btn .button-text {
       display: none;
   }
}

/* 附件样式 */
.email-attachments {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.attachments-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.attachments-title i {
    font-size: 16px;
    color: #1E9FFF;
}

.attachments-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8f8f8;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    min-width: 0;
}

.attachment-item:hover {
    background: #e8f4ff;
    box-shadow: 0 2px 8px rgba(30, 159, 255, 0.2);
}

.attachment-item > i {
    font-size: 24px;
    flex-shrink: 0;
}

/* 不同文件类型的图标颜色 */
.attachment-item.file-image > i {
    color: #FF5722;
}

.attachment-item.file-document > i {
    color: #2196F3;
}

.attachment-item.file-archive > i {
    color: #FFC107;
}

.attachment-item.file-other > i {
    color: #1E9FFF;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-size {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 附件悬浮提示样式 */
.attachment-item::after {
    content: attr(data-filename);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    z-index: 1000;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-item:hover::after {
    opacity: 1;
}

.email-body-container {
    flex-grow: 1;
    overflow: auto; /* 允许容器滚动,防止被内容撑开 */
    position: relative; /* 为iframe提供定位上下文 */
    min-width: 0; /* 防止flex子元素被内容撑开 */
}

.email-body-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block; /* 消除inline元素的间隙 */
}

/* 占位符样式 */
.placeholder {
    text-align: center;
    color: #888;
    padding: 50px;
    font-size: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: 70px 1fr 70px 1fr;
    gap: 8px 10px;
    font-size: 14px;
    color: #555;
}

.info-grid .info-label {
    font-weight: bold;
    text-align: right;
}

/* 移动邮件弹窗内的树形组件样式 */
.folder-tree-panel {
    padding: 20px;
}

.layui-tree-main {
    vertical-align: auto;
}

.folder-tree-panel .layui-tree-entry {
    padding: 0px 10px;
    border-radius: 4px;
    height: 32px; /* 固定高度 */
    line-height: 32px; /* 垂直居中 */
    cursor: pointer;
}

.folder-tree-panel .layui-tree-entry:hover {
    background-color: #f0f2f5; /* 调整悬浮背景色 */
}

.folder-tree-panel .layui-tree-line .layui-tree-entry:hover .layui-tree-txt {
    text-decoration: none;
}

/* 附件上传区域样式 */
#attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-upload-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #e6e6e6;
    transition: all 0.2s;
}

.attachment-upload-item:hover {
    background: #f0f0f0;
}

.attachment-upload-item .attachment-icon {
    font-size: 20px;
    margin-right: 10px;
    color: #1E9FFF;
}

.attachment-upload-item .attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-upload-item .attachment-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-upload-item .attachment-size {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.attachment-upload-item .attachment-remove {
    margin-left: 10px;
    cursor: pointer;
    color: #ff5722;
    font-size: 18px;
    transition: color 0.2s;
}

.attachment-upload-item .attachment-remove:hover {
    color: #ff0000;
}

/* 局部加载遮罩层样式 */
.local-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 1);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.local-loading-overlay.active {
    display: flex;
}

.local-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1E9FFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 为需要加载遮罩的容器添加相对定位 */
#email-list-wrapper,
#email-detail-container {
    position: relative;
}

/* 邮箱徽标输入组件样式 */
.email-tags-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    background-color: #fff;
    min-height: 38px;
    cursor: text;
    transition: border-color 0.3s;
}

.email-tags-container:focus-within {
    border-color: #1E9FFF;
}

.email-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: #1E9FFF;
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 300px;
    transition: background-color 0.2s;
}

.email-tag:hover {
    background-color: #0d7ecc;
}

.email-tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-tag-remove {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.email-tag-remove:hover {
    opacity: 1;
}

.email-tags-input {
    flex: 1;
    min-width: 150px;
    border: none;
    outline: none;
    padding: 4px;
    font-size: 14px;
    background: transparent;
}

.email-tags-input::placeholder {
    color: #999;
}

/* 写邮件弹窗样式 - 参考登录页面 */
#compose-email-modal .compose-input-wrapper {
    position: relative;
}

#compose-email-modal .compose-input-wrapper .layui-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    padding: 20px 15px 10px 15px;
    height: 56px;
    line-height: 1.5;
    transition: all 0.3s;
}

#compose-email-modal .compose-input-wrapper .layui-input:focus,
#compose-email-modal .compose-input-wrapper .layui-input:not(:placeholder-shown) {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

#compose-email-modal .compose-input-wrapper .form-label {
    position: absolute;
    top: 12px;
    left: 15px;
    color: #999;
    transition: all 0.2s ease;
    pointer-events: none;
    background-color: #fff;
    padding: 0 5px;
    z-index: 1;
}

#compose-email-modal .compose-input-wrapper .layui-input:focus ~ .form-label,
#compose-email-modal .compose-input-wrapper .layui-input:not(:placeholder-shown) ~ .form-label {
    top: -8px;
    left: 10px;
    font-size: 12px;
    color: #1890ff;
}

/* ===== 折叠展开功能样式 ===== */

/* 折叠按钮基础样式 */
.collapse-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 80px;
    background-color: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* PC端按钮保持可见 */
@media (min-width: 1001px) {
    .collapse-btn {
        display: flex !important;
    }
}

.collapse-btn:hover {
    background-color: #f5f7fa;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.collapse-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.collapse-btn i {
    font-size: 18px;
    color: #666;
    transition: transform 0.3s ease;
}

.collapse-btn:hover i {
    color: #1E9FFF;
}

/* 左侧折叠按钮 */
.collapse-btn-left {
    left: 0;
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* 右侧折叠按钮 */
.collapse-btn-right {
    right: 0;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* PC端折叠状态 */
.column-one {
    transition: all 0.3s ease;
}

.column-one.collapsed {
    flex: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    border-right: 0;
}

.column-three {
    transition: all 0.3s ease;
}

.column-three.collapsed {
    flex: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
}

/* PC端折叠按钮图标变化已通过JS控制，这里不需要额外的旋转样式 */

/* 移动端遮罩层 */
.mobile-overlay {
    position: fixed;
    top: 60px; /* 顶部导航栏高度 */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

.mobile-overlay.show {
    opacity: 1;
    pointer-events: auto;
}


/* 移动端搜索栏 */
.mobile-search-container {
    padding: 10px;
    background-color: #fff;
    border-bottom: 1px solid #e6e6e6;
}

.mobile-search-bar {
    display: flex;
    gap: 5px;
}

.mobile-search-bar .layui-input {
    flex: 1;
    height: 36px;
}

.mobile-search-bar .layui-btn {
    height: 36px;
    padding: 0 15px;
}

/* ===== 响应式样式 (平板端 1001-1400px) ===== */
@media (min-width: 1001px) and (max-width: 1400px) {
    /* 恢复hover效果，但选中状态优先级更高 */
    .account-list-item:hover:not(.selected):not(:has(.folder-item-container:hover)) > .account-item-main {
        background-color: rgba(193, 197, 201, 0.5);
    }
    
    /* 选中状态的样式优先级最高 */
    .account-list-item.selected > .account-item-main {
        background-color: rgba(193, 197, 201, 0.8) !important;
    }
    
    .folder-item-container:hover:not(.selected) {
        background-color: rgba(193, 197, 201, 0.5);
    }
    
    .folder-item.selected > .folder-item-container {
        background-color: rgba(193, 197, 201, 0.8) !important;
    }
    
    .toggle-icon-wrapper:hover,
    .refresh-icon-wrapper:hover,
    .settings-icon-wrapper:hover {
        background-color: transparent;
    }
    
    .add-subfolder-icon:hover {
        color: #888;
    }
    
    /* 文件夹操作按钮始终显示，不依赖hover */
    .folder-actions {
        opacity: 1;
    }
    
    /* 左侧账户列表 - 悬浮折叠显示，宽度50% */
    .column-one {
        position: fixed;
        top: 60px;
        left: -50%;
        width: 50%;
        height: calc(100% - 60px);
        z-index: 1000;
        background-color: #f5f7fa;
        transition: left 0.3s ease;
        border-right: 1px solid #e6e6e6;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }
    
    .column-one.mobile-show {
        left: 0;
    }
    
    /* 邮件列表和详情保持正常PC布局 */
    .column-two {
        flex: 3;
    }
    
    .column-three {
        flex: 5;
    }
    
    /* 遮罩层 */
    .mobile-overlay {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100% - 60px);
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 999;
    }
    
    .mobile-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* 左侧按钮样式 - 圆形菜单按钮 */
    .collapse-btn-left {
        position: fixed !important;
        left: auto !important;
        right: 15px;
        top: auto !important;
        bottom: 90px;
        transform: none !important;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        background-color: #fff;
        border: 1px solid #d2d2d2;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        z-index: 1003 !important;
        display: flex !important;
    }
    
    .collapse-btn-left:hover {
        background-color: #f5f7fa;
        border-color: #999;
    }
    
    .collapse-btn-left:active {
        transform: scale(0.95) !important;
    }
    
    .collapse-btn-left i {
        color: #666;
        font-size: 20px;
    }
    
    /* 左侧按钮使用收缩右箭头图标 */
    .collapse-btn-left i::before {
        content: "\e668" !important; /* layui-icon-shrink-right */
    }

    /* 平板端隐藏右侧按钮 */
    .collapse-btn-right {
        display: none !important;
    }
}

/* ===== 响应式样式 (移动端) ===== */
@media (max-width: 1000px) {
    /* 恢复hover效果，但选中状态优先级更高 */
    .account-list-item:hover:not(.selected):not(:has(.folder-item-container:hover)) > .account-item-main {
        background-color: rgba(193, 197, 201, 0.5);
    }
    
    /* 选中状态的样式优先级最高 */
    .account-list-item.selected > .account-item-main {
        background-color: rgba(193, 197, 201, 0.8) !important;
    }
    
    .folder-item-container:hover:not(.selected) {
        background-color: rgba(193, 197, 201, 0.5);
    }
    
    .folder-item.selected > .folder-item-container {
        background-color: rgba(193, 197, 201, 0.8) !important;
    }
    
    .toggle-icon-wrapper:hover,
    .refresh-icon-wrapper:hover,
    .settings-icon-wrapper:hover {
        background-color: transparent;
    }
    
    .add-subfolder-icon:hover {
        color: #888;
    }
    
    /* 文件夹操作按钮始终显示，不依赖hover */
    .folder-actions {
        opacity: 1;
    }
    
    /* 隐藏PC端顶部搜索栏 */
    .header-center {
        display: none !important;
    }
    
    /* 显示移动端搜索栏 */
    .mobile-search-container {
        display: block !important;
    }
    
    /* 移动端主容器调整 */
    .main-container {
        position: relative;
        overflow: hidden;
    }
    
    /* 左侧账户列表 - 默认隐藏在左侧 */
    .column-one {
        position: fixed;
        top: 60px;
        left: -80%;
        width: 80%;
        height: calc(100% - 60px);
        z-index: 1000;
        background-color: #f5f7fa;
        transition: left 0.3s ease;
        border-right: 1px solid #e6e6e6;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }
    
    .column-one.mobile-show {
        left: 0;
    }
    
    /* 邮件列表 - 默认全屏显示 */
    .column-two {
        flex: 1;
        width: 100%;
        min-width: 100%;
        border-right: none;
        position: relative;
        /* z-index 已移除，避免创建层叠上下文导致内部fixed定位的按钮被覆盖 */
    }
    
    /* 邮件详情 - 默认隐藏在右侧 */
    .column-three {
        position: fixed !important;
        top: 60px;
        left: 100%;
        width: 100%;
        height: calc(100% - 60px);
        z-index: 1001;
        background-color: #fff;
        transition: left 0.3s ease;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    }
    
    .column-three.mobile-show {
        left: 0 !important;
    }
    
    /* 移动端折叠按钮调整 - 垂直排列 */
    .collapse-btn-left {
        position: fixed !important;
        left: auto !important;
        right: 15px;
        top: auto !important;
        bottom: 90px;
        transform: none !important;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        background-color: #fff;
        border: 1px solid #d2d2d2;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        z-index: 1003 !important;
        display: flex !important;
    }
    
    .collapse-btn-left:hover {
        background-color: #f5f7fa;
        border-color: #999;
    }
    
    .collapse-btn-left:active {
        transform: scale(0.95) !important;
    }
    
    .collapse-btn-left i {
        color: #666;
        font-size: 20px;
    }
    
    /* 移动端左侧按钮使用收缩右箭头图标 */
    .collapse-btn-left i::before {
        content: "\e668" !important; /* layui-icon-shrink-right */
    }
    
    /* 移动端详情打开时，左侧按钮变为返回图标 */
    .collapse-btn-left.show-detail i::before {
        content: "\e65c" !important; /* layui-icon-return - 返回图标 */
    }
    
    /* 移动端隐藏右侧按钮 */
    .collapse-btn-right {
        display: none !important;
    }
    
    /* 移动端邮件列表高度调整 */
    .column-two .email-list-toolbar,
    .column-two #email-list-wrapper {
        touch-action: pan-y; /* 允许垂直滚动 */
    }
    
    /* 确保左侧按钮在所有情况下都可见 */
    .collapse-btn-left {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 移动端隐藏邮件列表项操作按钮 */
    .email-item .email-item-actions,
    .email-item:hover .email-item-actions,
    .touch-device .email-item .email-item-actions {
        display: none !important;
    }

    /* 移动端邮件详情信息样式调整 */
    .email-info-panel .info-grid {
        grid-template-columns: 70px 1fr;
    }
}

/* 确保移动端操作按钮完全隐藏（更高优先级） */
@media (max-width: 1000px) {
    .column-two .email-item .email-item-actions {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* ===== 邮件上下文菜单样式 ===== */
.email-context-menu {
    position: fixed;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding: 5px 0;
    min-width: 160px;
    z-index: 9999;
    display: none;
}

.email-context-menu.show {
    display: block;
}

.email-context-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
    color: #333;
    font-size: 14px;
}

.email-context-menu-item:hover {
    background-color: #f5f7fa;
}

.email-context-menu-item:active {
    background-color: #e8eaed;
}

.email-context-menu-item i {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.email-context-menu-item.danger {
    color: #ff5722;
}

.email-context-menu-item.danger:hover {
    background-color: #fff3f0;
}

.email-context-menu-divider {
    height: 1px;
    background-color: #e6e6e6;
    margin: 5px 0;
}

.folder-settings-icon {
    font-size: 14px; /* 调小图标 */
    color: #888;
    padding: 5px; /* 增加点击区域 */
    border-radius: 3px;
    transition: background-color 0.2s, color 0.2s;
}

.folder-settings-icon:hover {
    color: #333;
}

/* 顶部用户菜单分隔线样式 */
.top-header .layui-nav-child dd > .layui-nav-divider {
    margin: 3px 0;
}

